import {createRouter, createWebHashHistory} from "vue-router";

const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            name: 'index',
            component: () => import('@/views/frame/layout'),
            children: [
                {
                    path: '/home',
                    name: 'home',
                    component: () => import('@/views/home.vue')
                },
                {
                    path: '/detail',
                    name: 'detail',
                    component: () => import('@/views/detail.vue')
                },
                {
                    path: '/projectList',
                    name: 'projectList',
                    component: () => import('@/views/frame/project/list')
                },
                {
                    path: '/chartList',
                    name: 'chartList',
                    component: () => import('@/views/frame/chart/list')
                },
                {
                    path: '/systemCmp',
                    name: 'systemCmp',
                    component: () => import('@/views/frame/cmp/system')
                },
                {
                    path: '/customCmp',
                    name: 'customCmp',
                    component: () => import('@/views/frame/cmp/custom')
                }
            ]
        }
    ],
    scrollBehavior() {
        return {left: 0, top: 0}
    } // 跳转到顶部
})

export default router
